Skip to content

Fix BlockchainQueries::gasPrice when chain head block body still not fully persisted#7482

Merged
fab-10 merged 2 commits intobesu-eth:mainfrom
fab-10:fix-blockchainQueries-getPrice
Aug 19, 2024
Merged

Fix BlockchainQueries::gasPrice when chain head block body still not fully persisted#7482
fab-10 merged 2 commits intobesu-eth:mainfrom
fab-10:fix-blockchainQueries-getPrice

Conversation

@fab-10
Copy link
Copy Markdown
Contributor

@fab-10 fab-10 commented Aug 19, 2024

PR description

As well explained by @matthew1001 here, since in PR #7102, the current chain head is correctly included in the computation of the gasPrice, it could happen that the chain head block body is still not persisted, so in order to always retrieve it successfully we first try optimistically, then if not found, the new getBlockBodySafe that is synchronized and so will wait until the pending persist operation is done.

Fixed Issue(s)

fixes #7287

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

…fully persisted

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
@fab-10 fab-10 force-pushed the fix-blockchainQueries-getPrice branch from 81bf4fd to 444cd7d Compare August 19, 2024 11:51
@fab-10 fab-10 changed the title Fix BlockchainQueries::getPrice when chain head block body still not fully persisted Fix BlockchainQueries::gasPrice when chain head block body still not fully persisted Aug 19, 2024
@fab-10 fab-10 marked this pull request as ready for review August 19, 2024 11:59
Copy link
Copy Markdown
Contributor

@matthew1001 matthew1001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @fab-10

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
@fab-10 fab-10 merged commit 0dffe63 into besu-eth:main Aug 19, 2024
@fab-10 fab-10 deleted the fix-blockchainQueries-getPrice branch August 19, 2024 13:20
cloudspores pushed a commit to cloudspores/besu that referenced this pull request Aug 23, 2024
…fully persisted (besu-eth#7482)

* Fix BlockchainQueries::gasPrice when chain head block body still not fully persisted

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
gconnect pushed a commit to gconnect/besu that referenced this pull request Aug 26, 2024
…fully persisted (besu-eth#7482)

* Fix BlockchainQueries::gasPrice when chain head block body still not fully persisted

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: gconnect <agatevureglory@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eth_gasPrice ERROR Could not retrieve block

2 participants